home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WW3DKit / noise.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  550 b   |  24 lines

  1.  
  2. /*
  3.  * Declarations and preprocessor definitions used in the various noise
  4.  * functions.
  5.  * Darwyn Peachey, June, 1994.
  6.  */
  7.  
  8. #ifndef _NOISE_H_
  9. #define _NOISE_H_ 1
  10.  
  11. #define TABSIZE          256
  12. #define TABMASK          (TABSIZE-1)
  13. #define PERM(x)          perm[(x)&TABMASK]
  14. #define INDEX(ix,iy,iz)  PERM((ix)+PERM((iy)+PERM(iz)))
  15.  
  16. #define RANDMASK  0x7fffffff
  17. #define RANDNBR   ((random() & RANDMASK)/(double) RANDMASK)
  18.  
  19. extern unsigned char perm[TABSIZE];    /* see perm.c */
  20.  
  21. extern float catrom2(float d);        /* see catrom2.c */
  22.  
  23. #endif /* _NOISE_H_ */
  24.